﻿<%@ Page Language="C#" MasterPageFile="~/Report/reportSite.master" AutoEventWireup="true" CodeFile="RevenueStatistic_Report.aspx.cs"
    Theme="DXConnect" Inherits="Revenue_ReportForm" %>
<%@ Register assembly="DevExpress.Web.ASPxEditors.v12.1, Version=12.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dx1" %>
<%@ Register assembly="DevExpress.XtraCharts.v12.1.Web, Version=12.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.XtraCharts.Web" tagprefix="dxchartsui" %>
<%@ Register assembly="DevExpress.XtraCharts.v12.1, Version=12.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.XtraCharts" tagprefix="cc1" %>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <div class="mainContent registration">
        <div class="contentHeader">
            <div class="content">
                <img id="registrationTitle" src="../Images/title_revenue.png" alt="Schedule" />
            </div>
        </div>
        <div class="content">

            <table style="width:100%;">
                <tr>
                    <td style="width: 120px">
                        &nbsp;</td>
                    <td>
                        &nbsp;<br />
                        <dx1:ASPxRadioButton ID="overallRadio" runat="server" AutoPostBack="True" 
                            EnableTheming="True" oncheckedchanged="overallRadio_CheckedChanged" 
                            Text="Overall Statistic" Theme="Office2010Blue" GroupName="viewtype">
                            <ClientSideEvents CheckedChanged="function(s, e) {
}" />
                        </dx1:ASPxRadioButton>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<dx1:ASPxRadioButton 
                            ID="bydateRadio" runat="server" 
                            AutoPostBack="True" oncheckedchanged="bydateRadio_CheckedChanged" 
                            Text="Statistic by date" Theme="Office2010Blue" GroupName="viewtype">
                            <ClientSideEvents CheckedChanged="function(s, e) {
}" />
                        </dx1:ASPxRadioButton>
                        <dx1:ASPxDateEdit ID="DatePicker" runat="server" AutoPostBack="True" 
                            ondatechanged="DatePicker_DateChanged" style="margin-bottom: 0px" 
                            Theme="Office2010Blue" Width="170px">
                        </dx1:ASPxDateEdit>
                             </td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td style="width: 120px">
                        &nbsp;</td>
                    <td>
                        <dxchartsui:WebChartControl ID="revenueStatisticWebChartControl" runat="server" 
                            CrosshairEnabled="True" DataSourceID="RevenueDataSource" Height="683px" 
                            Width="824px" AppearanceNameSerializable="Nature Colors" 
                            SideBySideEqualBarWidth="True">
                            <emptycharttext antialiasing="False" />
                            <smallcharttext antialiasing="False" />
                            <diagramserializable>
                                <cc1:XYDiagram>
                                    <axisx visibleinpanesserializable="-1" title-antialiasing="False" 
                                        title-text="Products Model" title-visible="True">
                                        <range sidemarginsenabled="True" />
                                        <label enableantialiasing="False">
                                        </label>
<Range SideMarginsEnabled="True"></Range>
                                    </axisx>
                                    <axisy visibleinpanesserializable="-1" title-antialiasing="False" 
                                        title-text="Total Revenue" title-visible="True">
                                        <range sidemarginsenabled="True" />
                                        <label enableantialiasing="False">
                                        </label>
<Range SideMarginsEnabled="True"></Range>
                                    </axisy>
                                </cc1:XYDiagram>
                            </diagramserializable>
<FillStyle><OptionsSerializable>
<cc1:SolidFillOptions></cc1:SolidFillOptions>
</OptionsSerializable>
</FillStyle>

                            <legend alignmenthorizontal="Center" alignmentvertical="BottomOutside" 
                                direction="LeftToRight"></legend>
                            <seriesserializable>
                                <cc1:Series ArgumentDataMember="Model" CrosshairLabelVisibility="True" 
                                    LabelsVisibility="True" Name="Revenue" SynchronizePointOptions="False" 
                                    ValueDataMembersSerializable="Revenue">
                                    <viewserializable>
                                        <cc1:SideBySideBarSeriesView BarWidth="0.3" Color="CadetBlue" ColorEach="True">
                                        </cc1:SideBySideBarSeriesView>
                                    </viewserializable>
                                    <labelserializable>
                                        <cc1:SideBySideBarSeriesLabel BackColor="Azure" 
                                            LineVisible="True">
                                            <fillstyle>
                                                <optionsserializable>
                                                    <cc1:SolidFillOptions />
                                                </optionsserializable>
                                            </fillstyle>
                                            <pointoptionsserializable>
                                                <cc1:PointOptions>
                                                </cc1:PointOptions>
                                            </pointoptionsserializable>
                                        </cc1:SideBySideBarSeriesLabel>
                                    </labelserializable>
                                    <legendpointoptionsserializable>
                                        <cc1:PointOptions PointView="ArgumentAndValues">
                                            <valuenumericoptions format="Number" />
                                        </cc1:PointOptions>
                                    </legendpointoptionsserializable>
                                </cc1:Series>
                            </seriesserializable>

<SeriesTemplate><ViewSerializable>
<cc1:SideBySideBarSeriesView></cc1:SideBySideBarSeriesView>
</ViewSerializable>
<LabelSerializable>
<cc1:SideBySideBarSeriesLabel LineVisible="True">
<FillStyle><OptionsSerializable>
<cc1:SolidFillOptions></cc1:SolidFillOptions>
</OptionsSerializable>
</FillStyle>
<PointOptionsSerializable>
<cc1:PointOptions></cc1:PointOptions>
</PointOptionsSerializable>
</cc1:SideBySideBarSeriesLabel>
</LabelSerializable>
<LegendPointOptionsSerializable>
<cc1:PointOptions></cc1:PointOptions>
</LegendPointOptionsSerializable>
</SeriesTemplate>

                            <titles>
                                <cc1:ChartTitle Text="Total Revenue Statistic By Product" />
                            </titles>

<CrosshairOptions showargumentlabels="True" showargumentline="True" showvaluelabels="True" 
                                showvalueline="True"><CommonLabelPositionSerializable>
<cc1:CrosshairMousePosition></cc1:CrosshairMousePosition>
</CommonLabelPositionSerializable>
</CrosshairOptions>

<ToolTipOptions><ToolTipPositionSerializable>
<cc1:ToolTipMousePosition></cc1:ToolTipMousePosition>
</ToolTipPositionSerializable>
</ToolTipOptions>
                        </dxchartsui:WebChartControl>
                        <asp:SqlDataSource ID="RevenueDataSource" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:CocShopDatabaseConnectionString %>" 
                            
                            
                            SelectCommand="SELECT Product.Model, A.TotalQuantity * Product.Price AS Revenue FROM Product INNER JOIN (SELECT ProductID, SUM(Quantity) AS TotalQuantity FROM OrderScheduling  GROUP BY ProductID) AS A ON A.ProductID = Product.ProductID">
                        </asp:SqlDataSource>
                    </td>

                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td style="width: 120px">
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td style="width: 120px">
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                </tr>
            </table>

        </div>
    </div>
</asp:Content>
